package com.flying.classmember.block;

/**
 * @ClassName: Student
 * @author: 刘鹏飞
 * @date 2023/7/18 18:09
 * @Description:
 */
public class Student {
    //  静态代码块用来初始化类对象
    static {
        System.out.println("Student类初始化了");
        String m = "yes";
        System.out.println("m = " + m);
        // System.out.println(x);  //
    }

    //  构造代码块用来初始化对象
    {
        System.out.println("对象初始化了");
        int i = 10086;

    }

    private int score = 100;
    public static String x = "good";

    public Student() {
        System.out.println("无惨构造方法被调用了");
    }

    public Student(int score) {
        System.out.println("有参构造方法被调用了");
        this.score = score;
    }
}
